<template>
	<view class="p-l-30 p-r-30">
		<u-modal :show="modalShow" title="确定要注销登录吗？" @confirm="btnLogout"></u-modal>

		<u-button type='error' @tap="modalShow = true">退出登录</u-button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				modalShow: false
			}
		},
		methods: {
			btnLogout() {
				this.$store.dispatch('user/logout').then(() => {
					console.log("退出成功")
					this.$Router.replace({
						name: "Login"
					})
				})
			}
		}
	}
</script>

<style>
</style>